/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.vfi.bc;

import edu.upn.sigemfi.vfi.be.DetalleTransaccion;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Programador
 */
@Stateless
public class DetalleTransaccionFacade implements DetalleTransaccionFacadeLocal {
   @PersistenceContext(unitName="edu.upn.sigemfi.vfi-ejbPU")
    private EntityManager em;

    public void create(DetalleTransaccion detalleTransaccion) {
        em.persist(detalleTransaccion);
    }

    public void edit(DetalleTransaccion detalleTransaccion) {
        em.merge(detalleTransaccion);
    }

    public void remove(DetalleTransaccion detalleTransaccion) {
        em.remove(em.merge(detalleTransaccion));
    }

    public DetalleTransaccion find(Object id) {
        return em.find(DetalleTransaccion.class, id);
    }

    public List<DetalleTransaccion> findAll() {
        return em.createQuery("select object(o) from DetalleTransaccion as o").getResultList();
    }

}
